/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package desarrollo.Form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author ramiro
 */
public class form extends org.apache.struts.action.ActionForm {
    
    private String username;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String string) {
        username = string;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String i) {
        password = i;
    }

    public form() {
        super();
    }

    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getUsername().equals("Ramiro") && getUsername().equals("8162889")){
            System.out.print("<h1> HOLA RAMIRO <h1>");
            
        } 
        else{
            errors.add("username", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }
}
